<template>
  <div>
    
  <el-select v-model="value" placeholder="请选择">
    <el-option
      v-for="item in options"
      :key="item.id"
      :label="item.keyname"
      :value="item.id">
    </el-option>
  </el-select>
 
  <el-button type="primary" v-on:click="submit" >提交</el-button>

</div>
</template>

<script>
  import {fetchList} from '@/api/sys/dict'
  export default {
    data() {
      return {
        options: [],
        value: ''
      }
    },

    created() {
      this.initData();
    },

    methods: {
      initData(){
        fetchList(null).then(response => {
          this.options  = response.data.records; 
        });  
      },

      submit(){
        alert(this.value)
      },


    },

  }
</script>